Functions that take or return other functions — the backbone of functional JS.
A higher-order function is simply a function that takes another function as an argument, returns a function, or both. This is only possible because functions in JavaScript are first-class values, and it's the mechanism behind some of the most commonly used parts of the language — map, filter, and reduce are all higher-order functions, since each one takes a callback and decides when and how to invoke it.
The pattern goes beyond array methods, though. Function decorators (wrapping a function to add logging, timing, or memoization without changing its original code), event handler factories (a function that returns a configured handler), and middleware chains (as in Express) are all higher-order functions in disguise — a function generating or wrapping other functions is what makes composition and code reuse possible without duplicating logic.
What you'll walk away knowing